# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Contributor: damir <damir@archlinux.org>

pkgname=x11vnc
epoch=1
pkgver=0.9.15
pkgrel=1
pkgdesc='VNC server for real X displays'
url='https://github.com/LibVNC/x11vnc'
arch=('x86_64')
license=('GPL2')
optdepends=('tk: GUI support'
            'net-tools: -auth guess'
            'xf86-video-dummy: Xdummy script')
depends=('libvncserver' 'openssl' 'libjpeg' 'libxtst' 'libxinerama'
         'libxdamage' 'libxrandr' 'avahi' 'xorg-xdpyinfo')
source=("https://github.com/LibVNC/x11vnc/archive/${pkgver}.tar.gz"
        'service')
sha256sums=('3e43bd875edc3c7f52a0d3676c4ec7de910fcd210240ee20b4522deb2bf84cff'
            'cfb19d44e09e960e2fdb958c9258bccf23c2677715314985f7e819f1dcedb6e4')

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	autoreconf -fi
	./configure --prefix=/usr --mandir=/usr/share/man
	make
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	make DESTDIR="${pkgdir}" install
	install misc/{rx11vnc,Xdummy} "${pkgdir}"/usr/bin
	install -Dm644 ../service "${pkgdir}/usr/lib/systemd/system/x11vnc.service"
}
